domain builder and in to python code.
This knowledge will be useful to allow us to pre-seed the protocol
field in a VBD entry in xenstore which will allow us to run older
kernels in a 32on64 mixed environment.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
int (*vcpu) (struct xc_dom_image * dom, void *vcpu_ctxt);
char *guest_type;
+ char *native_protocol;
int page_shift;
int sizeof_pfn;
#include <xen/foreign/x86_64.h>
#include <xen/hvm/hvm_info_table.h>
#include <xen/hvm/e820.h>
+#include <xen/io/protocols.h>
#include "xg_private.h"
#include "xc_dom.h"
static struct xc_dom_arch xc_dom_32 = {
.guest_type = "xen-3.0-x86_32",
+ .native_protocol = XEN_IO_PROTO_ABI_X86_32,
.page_shift = PAGE_SHIFT_X86,
.sizeof_pfn = 4,
.alloc_magic_pages = alloc_magic_pages,
};
static struct xc_dom_arch xc_dom_32_pae = {
.guest_type = "xen-3.0-x86_32p",
+ .native_protocol = XEN_IO_PROTO_ABI_X86_32,
.page_shift = PAGE_SHIFT_X86,
.sizeof_pfn = 4,
.alloc_magic_pages = alloc_magic_pages,
static struct xc_dom_arch xc_dom_64 = {
.guest_type = "xen-3.0-x86_64",
+ .native_protocol = XEN_IO_PROTO_ABI_X86_64,
.page_shift = PAGE_SHIFT_X86,
.sizeof_pfn = 8,
.alloc_magic_pages = alloc_magic_pages,
unsigned long console_mfn = 0;
PyObject* elfnote_dict;
PyObject* elfnote = NULL;
+ PyObject* ret;
int i;
static char *kwd_list[] = { "domid", "store_evtchn", "memsize",
Py_DECREF(elfnote);
}
+ ret = Py_BuildValue("{s:i,s:i,s:N}",
+ "store_mfn", store_mfn,
+ "console_mfn", console_mfn,
+ "notes", elfnote_dict);
+
+ if ( dom->arch_hooks->native_protocol )
+ {
+ PyObject *native_protocol =
+ Py_BuildValue("s", dom->arch_hooks->native_protocol);
+ PyDict_SetItemString(ret, "native_protocol", native_protocol);
+ Py_DECREF(native_protocol);
+ }
+
xc_dom_release(dom);
- return Py_BuildValue("{s:i,s:i,s:N}",
- "store_mfn", store_mfn,
- "console_mfn", console_mfn,
- "notes", elfnote_dict);
+ return ret;
out:
xc_dom_release(dom);